layui.define(['jquery','form','layer'],function(exports){
	var $ = layui.$
	,form = layui.form
	,layer = layui.layer
	,obj = {
    	init: function(option){
			form.on('submit(formDemo)', function(data){
				$.ajax({
					type: "post",
					url: MyUrl.loginUrl,
					data: data.field,
					success: function (data) {
						if (data['status'] == 1) {
							location.href = MyUrl.loginSucessUrl;
						} else {
							layer.msg(data['info']);
						}
					}
				});
				
			});
		}
	};
	exports('login', obj);
});    

//登陆页面模块